<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>发票抬头</title>
    <style>
        * {
            box-sizing: border-box;
        }

        a {
            color: white;
            text-decoration: none;
        }

        body {
            margin: 0;
        }

        .home-content {
            width: 100%;
            height: 100vh;
            text-align: center;
        }

        .home-content h1 {
            color: white;
            font-size: 8vw;
            background-color: #1C86EE;
            padding: 2vw 0;
            margin: 0 0 6vw 0;
        }

        .a{
            width: 100%;
            border-radius: 3px;
            text-align: left;
            color: black;
            padding: 2vw 3vw;
            line-height: 9vw;
        }
        .submit{
            text-align:center;
            margin-top: 15px;
        }
        .submit input{
            width:80%;
            height:40px;
            background-color:#1C86EE;
            border-radius: 5px;
            font-size:16px;
            color:white;
        }
        table{
            width:98%;
            margin:0 auto;
        }
        table tr td{
            height:40px;
            text-align:center;
            border-bottom: 1px solid #333;
        }
        table tr td input{
            height:30px;
            width:90%;
            font-size:4.5vw;
            border:0px solid #ccc;
            background-color: #F7F7F7;
        }
    </style>
</head>
<script type="text/javascript" src="/static/admin/js/jquery.js"></script>
<body onload="init()">
    <form action="#" method="post">
        <div class="home-content" >
            <!--<h1 style="margin-bottom: 0px">早早停车</h1>
            <h1 style="margin-top:0px">无感支付电子发票</h1>-->
			<div style="height:140px">
				<img src="/static/index/images/invoiceapply.png" style="width:100%;height:100%"/>
			</div>
            <div style="text-align:left;padding-left:20px;margin-top:10px">
                <input type="hidden" name="parkingNo" value="{$parkingNo}" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="invoice_type" value="1" checked="checked" onclick="func1()"/>个人
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="invoice_type" value="2" onclick="func2()"/>企业
            </div>
            <div class="a" >
                <table id="table1" style=" width:98%;margin:0 auto;">
                    <tr style="width:100%">
                        <td style="width:35%">
                            手机号码
                        </td>
                        <td>
                            <input type="text" placeholder="输入手机号" name="phone" required/>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            金额
                        </td>
                        <td>
                            <input type="number" placeholder="金额" name="money" required//>
                        </td>
                    </tr>
					<tr>
                        <td>
                            车牌
                        </td>
                        <td>
                            <input type="text" placeholder="车牌" name="car_number" required//>
                        </td>
                    </tr>
                <!--</table>
                <table style="display: none; width:98%;margin:0 auto;" id="table2"> --> 
                    <tr style="width:100%" id="trname">
                        <td style="width:35%">
                            <span style="color:red;font-weight: bold">*</span>抬头名称
                        </td>
                        <td>
                            <input type="text" placeholder="输入抬头名称" name="buyerName"  id="name"/>
                        </td>
                    </tr> 
                    <tr style="width:100%" id="trtaxnum">
                        <td style="width:35%">
                            <span style="color:red;font-weight: bold">*</span>税号
                        </td>
                        <td>
                            <input type="text" placeholder="输入纳税人识别号" name="buyerTaxNum"  id="taxnum"/>
                        </td>
                    </tr>
                    <tr style="width:100%" id="traddress">
                        <td style="width:35%">
                            单位地址
                        </td>
                        <td>
                            <input type="text" placeholder="收票单位注册地址" name="buyerAddress"/>
                        </td>
                    </tr>
                    <tr style="width:100%" id="trtel">
                        <td style="width:35%">
                            电话号码
                        </td>
                        <td>
                            <input type="text" placeholder="输入公司电话号码" name="buyerTel"/>
                        </td>
                    </tr>
                    <tr style="width:100%" id="trbank">
                        <td style="width:35%">
                            开户银行
                        </td>
                        <td>
                            <input type="text" placeholder="收票单位开户银行" name="bank"/>
                        </td>
                    </tr>
                    <tr style="width:100%" id="traccount">
                        <td style="width:35%">
                            银行账号
                        </td>
                        <td>
                           <input type="text" placeholder="收票单位银行账号" name="account"/>
                        </td>
                    </tr>
                    
                </table>
                <div class="submit">
                    <input type="submit" value="提交申请" style="border:0px "/>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
<script>

    function checkForm(){
        
    }
    function func1(){
        document.getElementById("trtaxnum").style.display="none";
        document.getElementById("traddress").style.display="none";
        document.getElementById("trtel").style.display="none";
        document.getElementById("trbank").style.display="none";
        document.getElementById("traccount").style.display="none";
        document.getElementById("trname").style.display="none";
        document.getElementById("taxnum").required=false; 
    }
    function func2(){
        document.getElementById("trtaxnum").style.display="table-row";
        document.getElementById("traddress").style.display="table-row";
        document.getElementById("trtel").style.display="table-row";
        document.getElementById("trbank").style.display="table-row";
        document.getElementById("traccount").style.display="table-row";
        document.getElementById("trname").style.display="table-row";
        document.getElementById("taxnum").required=true; 
    }
    function init(){
        if(getradio()=="1"){
            document.getElementById("trtaxnum").style.display="none";
            document.getElementById("traddress").style.display="none";
            document.getElementById("trtel").style.display="none";
            document.getElementById("trbank").style.display="none";
            document.getElementById("traccount").style.display="none";
			 document.getElementById("trname").style.display="none";
            document.getElementById("taxnum").required=false; 
        }else{
            document.getElementById("trtaxnum").style.display="table-row";
            document.getElementById("traddress").style.display="table-row";
            document.getElementById("trtel").style.display="table-row";
            document.getElementById("trbank").style.display="table-row";
            document.getElementById("traccount").style.display="table-row";
			 document.getElementById("trname").style.display="table-row";
            document.getElementById("taxnum").required=true; 
        }
    }

    function getradio(){
        var radios = document.getElementsByName("invoice_type");
        var value = 0;
        for(var i=0;i<radios.length;i++){
            if(radios[i].checked == true){
                value = radios[i].value;
            }
        }
       return value;
    }
    
   
 console.log($("input[name='invoice_type']").val());

</script>